package parser

import (
	"github.com/PuerkitoBio/goquery"
	"log"
	"my_git_repos/gocn_daily_news/controllers/crawl/types"
)
func DayParser(url string) *types.Response {
	doc, err := GetDocFromUrl(url)
	if err != nil {
		log.Printf("NewDocument(%s) err: %v\n", url, err)
		return nil
	}

	res := new(types.Response)

	doc.Find("div.mod-body div.content ol li").Each(func(i int, liSel *goquery.Selection) {
		res.Contents = append(res.Contents, liSel.Text())
	})

	return res
}